<template>
  <div>
    <table>
      <tr>
        <th>编号</th>
        <th>品牌名称</th>
        <th>创立时间</th>
        <th>操作</th>
      </tr>
      <tr v-for="(tabl, indax) in arr" :key="tabl.id">
        <td>{{ tabl.id }}</td>
        <td>{{ tabl.usname }}</td>
        <td>{{ tabl.age }}</td>
        <td>
          <button @click="del(indax)">删除</button>
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [
        { id: 1, usname: "奔驰", age: "2020 - 08 - 08" },
        { id: 2, usname: "宝马", age: "2020 - 08 - 08" },
        { id: 3, usname: "奥迪", age: "2020 - 08 - 08" },
      ],
    };
  },
  methods: {
    del(index) {
      this.arr.splice(index, 1);
    },
  },
};
</script>

<style>
</style>